from distutils.core import setup, Extension
from commands import getoutput

cflags = getoutput('pkg-config --cflags gtk+-2.0 xtst')
libs = getoutput('pkg-config --libs gtk+-2.0 xtst')

includes = [x[2:] for x in cflags.split() if x[:2] == '-I']
libraries = [x[2:] for x in libs.split() if x[:2] == '-l']
module = Extension('gtktesterinit',
                    sources = ['gtktesterinitmodule.c', '../../gtktestermodule.c', '../../gtktester.c', '../../gtktester_search.c', '../../gtktester_lowlevel_x11.c'],
                    include_dirs = ['../../'] + includes,
                    libraries = libraries
                    )

setup (name = 'gtktester',
       version = '1.0',
       description = 'Automatic testing for Gtk apps',
       author = 'Anthony Lenton',
       author_email = 'anthony@except.com.ar',
       ext_modules = [module])
